package com.shop2cn.iapi.sqoptrade.service;

import org.json.JSONObject;

import com.ymt.base.YmatouBaseCall;
import com.ymttest.utils.EnvSetup;

/**
 * 对已关闭退单重新开启接口Call FreeMaker Template自动生成代码
 */
public class ReapplyRefundCall extends YmatouBaseCall {
	private static String opurl = "api/SalesRefund/ReapplyRefund";

	public ReapplyRefundCall() {
		super(EnvSetup.getSystemUrl("operate2_iapi"), opurl, "POST", "JSON");
	}

	@Override
	public void addDefHeader() {
		client.addHeader("Accept",
				"text/xml,text/javascript,text/html,application/json");
		client.addHeader("Content-Type", "application/json; charset=UTF-8");
	}

	/**
	 * 获取data
	 * 
	 * @return
	 */
	public JSONObject getData() {
		JSONObject data = null;
		try {
			data = (JSONObject) new JSONObject(getReturnData()).get("data");
		} catch (Exception e) {
			e.printStackTrace();
		}
		return data;
	}
	/**
	 * 获取Success
	 * 
	 * @return
	 */
	public boolean getSuccess() {
		boolean Success = false;
		try {
			Success = getData().getBoolean("success");
		} catch (Exception e) {
			e.printStackTrace();
		}
		return Success;
	}

}
